Skip to content

Conversation

@cvvergara
Copy link
Member

Fixes #2913

Changes proposed in this pull request:
Standardizing pgr_DAGshortestPath to one path result columns
Its an experimental function

  • New SQL internal function
  • _pgr_dagShortestPath_v4
  • Old SQL removed and C code moved to legacy
    • _pgr_dagShortestPath
  • Tests for 4.0.0+
  • Added to migration section for one path result columns
  • Documentation adjusted to standardization
  • Example queries for documentation upgraded
  • Update script adjusted

@pgRouting/admins

cvvergara and others added 3 commits June 14, 2025 05:55
Its an experimental function

- New SQL internal function
  - _pgr_dagShortestPath_v4
- Old SQL removed and C code moved to legacy
  - _pgr_dagShortestPath
- Tests for 4.0.0+
- Added to migration section for one path result columns
- Documentation adjusted to standardization
- Example queries for documentation upgraded
- Update script adjusted
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jun 14, 2025

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

✨ Finishing Touches
🧪 Generate Unit Tests
  • Create PR with Unit Tests
  • Commit Unit Tests in branch issue-2913-standardize-output-columns-dag_sp
  • Post Copyable Unit Tests in Comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai auto-generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@cvvergara cvvergara changed the title Issue 2913 standardize output columns dag sp Issue 2913 standardize output columns pgr_dagShortestPath Jun 14, 2025
@cvvergara
Copy link
Member Author

@coderabbitai summary
@coderabbitai review

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jun 14, 2025

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

@cvvergara I'll generate both the summary and conduct a review of this PR. Let me gather the necessary information first.


🏁 Script executed:

#!/bin/bash
# Get PR information and changed files
echo "=== PR Information ==="
gh pr view 2918 --json title,body,headRefName,baseRefName,author

echo -e "\n=== Changed Files ==="
gh pr diff 2918 --name-only

echo -e "\n=== PR Diff ==="
gh pr diff 2918

Length of output: 61680


@cvvergara Here's the summary and review for PR #2918:

Summary

This PR standardizes the output columns of pgr_DAGshortestPath to align with the pgRouting 4.0.0 column standardization initiative (fixes #2913).

Key Changes:

  • Output Format: Standardizes from (seq, path_seq, node, edge, cost, agg_cost) to (seq, path_seq, start_vid, end_vid, node, edge, cost, agg_cost)
  • New Implementation: Creates _pgr_dagShortestPath_v4 internal functions
  • Legacy Support: Moves old functions to legacy with proper deprecation
  • Documentation: Updates all docs, examples, and migration guides
  • Testing: Comprehensively updates test suite for new format

Impact: This is a breaking change for existing users, but provides consistency with other pgRouting functions in v4.0.0.

Code Review

Strengths

  1. Comprehensive Implementation: The standardization is thorough, covering SQL functions, C drivers, documentation, and tests
  2. Proper Deprecation: Old functions are correctly moved to legacy with deprecation notices
  3. Migration Support: Clear migration documentation and examples provided
  4. Consistent Naming: New internal functions follow _v4 naming convention
  5. Test Coverage: All test files properly updated for new column format

⚠️ Areas for Attention

  1. Function Signature Changes (Lines in dagShortestPath.c):
// The new function signature removes 'directed' parameter completely
// Old: _pgr_dagshortestpath(text,text,boolean,boolean) 
// New: _pgr_dagshortestpath_v4(text,text,boolean)

This appears intentional since DAG algorithms are inherently directed, but worth confirming this doesn't break existing usage patterns.

  1. Documentation Typo (Line in pgr_dagShortestPath.rst):
..rubric:: Version 3.0.0  // Missing leading dot

Should be .. rubric:: Version 3.0.0

  1. Test Migration: In several test files, the version check changed from '3.2.0' to '4.0.0' which correctly reflects when the standardized format becomes available.

🔧 Minor Issues

  1. Indentation: Some inconsistent spacing in CMakeLists.txt (mixing spaces/tabs)
  2. Language: Driver code removes some debug messages and simplifies error handling - ensure adequate logging remains for troubleshooting

Architecture Review

The refactoring follows good practices:

  • Clean separation between old and new implementations
  • Proper version-gated functionality
  • Maintains backward compatibility through legacy functions
  • Comprehensive update across all touchpoints (SQL, C++, docs, tests)

Recommendation: ✅ Approve - This is a well-executed standardization that properly handles the breaking change with appropriate migration support and maintains code quality standards.

🐰

   /|   /|  
  ( ._. )   *Successfully standardized!*
   > ^ <    

@cvvergara cvvergara merged commit f582cfe into pgRouting:develop Jun 16, 2025
26 checks passed
@cvvergara cvvergara deleted the issue-2913-standardize-output-columns-dag_sp branch June 16, 2025 14:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants